<?php

/*
# ------------------------------------------------------------------------
# JA Job Board Package
# ------------------------------------------------------------------------
# Copyright (C) 2004-2010 JoomlArt.com. All Rights Reserved.
# @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
# Author: JoomlArt.com
# Websites: http://www.joomlart.com - http://www.joomlancers.com.
# ------------------------------------------------------------------------
*/

  global $option;
  $user = JFactory::getUser();
  ?>

<div style="background-color:#FFFFEE; border:1px solid #EEEE00; margin-top:2em; padding:0.5em;">	
		<?php if ($user->id) { ?>	
			<div>
				<span style="color: red">
					<strong>
						<?php echo JText::_('Note'); ?>!
					</strong>
				</span>
				<div <?php echo $this->note->description!=''?'style="float:right;text-align:right;"':'style="float:right;text-align:right;display:none;"'; ?> id="div_view_button_<?php echo $item->id; ?>" >
					<img title="<?php echo JText::_('Edit note'); ?>" src="<?php echo JURI::base().'components/com_jajobboard/images/icon_edit.png' ?>" alt="<?php echo JText::_('Edit note'); ?>" />
					<a href="javascript:void(0)" onclick="show_edit_note('<?php echo $item->id; ?>')">			
						 <?php echo JText::_('Edit')?>
					</a>
				</div>
				<div <?php echo $this->note->description!=''?'style="float:right;text-align:right;display:none;"':'style="float:right;text-align:right;"'; ?> id="div_edit_button_<?php echo $item->id; ?>"  >
					<img title="<?php echo JText::_('Save'); ?>" src="<?php echo JURI::base().'components/com_jajobboard/images/save-16x16.png' ?>" alt="<?php echo JText::_('Save'); ?>" />&nbsp;
					<a href="javascript:void(0)" onclick="save_note('<?php echo $item->id; ?>', '<?php echo $user->id;?>', '<?php echo JRequest::getVar('view')=='jajobs'?'ja_jobs':'ja_resumes'; ?>')">				
						<?php echo JText::_('Save')?>
					</a>
					&nbsp;|&nbsp;
					<img title="<?php echo JText::_('Cancel'); ?>" src="<?php echo JURI::base().'components/com_jajobboard/images/Cancel-16x16.png' ?>" alt="<?php echo JText::_('Cancel'); ?>" />&nbsp;
					<a href="javascript:void(0)" onclick="cancel_note('<?php echo $item->id; ?>')">				
						 <?php echo JText::_('Cancel')?>
					</a>
				</div>
			</div>
			<div <?php echo $this->note->description?'':'style="display:none;"'; ?> class="jajb-item-note" id="view_note_<?php echo $item->id; ?>">
				<div title="<?php echo  JText::_('Click on message to edit note'); ?>" ondblclick="show_edit_note('<?php echo $item->id; ?>')" id="view_description_<?php echo $item->id; ?>">
			            					<?php echo isset($this->note)?$this->note->description:''; ?>
				<br /><br />
			    </div>		
			</div>
		
	
			<div id="edit_note_<?php echo $item->id; ?>" <?php echo $this->note->description?'style="display:none;"':''; ?>>
			
				<table width="100%">
				<tr>
				
					<td>
						<textarea rows="7" style="width: 99%" name="description_<?php echo $item->id; ?>" id="description_<?php echo $item->id; ?>"><?php echo isset($this->note)?$this->note->description:''; ?></textarea>
					</td>
				</tr>
				
				</table>
			 </div>
		 <script language="javascript">
		 var saved_note = <?php echo isset($this->note->description)?"true":'false'; ?>;
		 var save_note_url = "<?php echo JRoute::_("index.php?option=com_jajobboard&view=janotes")?>";
		 var saved_note_value = '<?php echo isset($this->note->description)?$this->note->description:''; ?>';
		 </script>
	 <?php } else { 
	 	$uri		= JFactory::getURI();
		$return		= $uri->toString();
	 ?>
	<span style="color: red">
		<strong>
			<?php echo JText::_('Note'); ?>!
		</strong>
	</span>
	<div id="remind_login_<?php echo $item->id; ?>">
		<?php echo JText::_('Please sign in to continue...'); ?>
		&nbsp;&nbsp;
		<a class="button" href="<?php echo JRoute::_(JURI::root().'index.php?option=com_user&view=login&return='.base64_encode($return)); ?>"><?php echo JText::_('Login') ?></a>
		
	</div>
	 
	 <?php } ?>
 </div>